@extends('user.base.index')
@section('sidebar')
@stop

@section('content')
    <!-- Responsive Table -->
    <h4 class="page-title">评论与回复管理</h4>
    <div class="block-area" id="responsiveTable">
        <h3 class="block-title">评论回复表</h3>
        <form action='/admin/eval' method='post' name='myform'>
            <input type='hidden' name='_token' value='{{ csrf_token() }}'>
            <input type="hidden" name='_method' value='DELETE'>
        </form>
        <form action='/admin/eval' method='get'>
            <div class='media-body'>
                标题：<input type='text' class='form-control m-b-5' name='title'>
            </div>
            <input type='submit' class='btn' value='搜索'>
        </form>
        <div class="table-responsive overflow">
            <table class="table tile">
                <thead>
                    <tr>
                        <th>No.</th>
                        <th>用户ID</th>
                        <th>产品ID</th>
                        <th>订单ID</th>
                        <th>评价标题</th>
                        <th>使用感受</th>
                        <th>评价时间</th>
                        <th>商家回复</th>
                        <th>回复时间</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                @foreach ($list as $v)
                    <tr>
                        <td>{{ $v->id }}</td>
                        <td>{{ $v->user_id }}</td>
                        <td>{{ $v->product_id }}</td>
                        <td>{{ $v->order_id }}</td>
                        <td>{{ $v->title }}</td>
                        <td>{{ $v->content }}</td>
                        <td>{{ $v->evaluation_time }}</td>
                        <td>{{ $v->reply_content }}</td>
                        <td>{{ $v->reply_time }}</td>
                        <td>
                            <a href="/admin/eval/{{ $v->order_id }}/edit" class='btn'>回复</a>
                            <a href="javascript:doDel({{ $v->id }})" class='btn'>删除</a>
                        </td>
                    </tr>
                @endforeach
                </tbody>
            </table>
            {{ $list->appends($where)->links() }}
            <script type="text/javascript">
            function doDel(id)
            {
                if(confirm('确定要删除么？')){
                    var form = document.myform;
                    form.action = '/admin/eval/'+id;
                    form.submit();
                }
            }
        </script>
        </div>
    </div>
@stop

